using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class FT_PKT_SalesmenMap : EntityTypeConfiguration<FT_PKT_Salesmen>
    {
        public FT_PKT_SalesmenMap()
        {
            // Primary Key
            this.HasKey(t => new { t.SALESMAN, t.SL_ID2 });

            // Properties
            this.Property(t => t.SALESMAN)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.SL_Email)
                .HasMaxLength(50);

            this.Property(t => t.SL_HomePhone)
                .HasMaxLength(50);

            this.Property(t => t.SL_BusinessPhone)
                .HasMaxLength(50);

            this.Property(t => t.SL_Mobile)
                .HasMaxLength(50);

            this.Property(t => t.SL_ID2)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("FT_PKT_Salesmen");
            this.Property(t => t.SALESMAN).HasColumnName("SALESMAN");
            this.Property(t => t.SL_Gender).HasColumnName("SL_Gender");
            this.Property(t => t.SL_BirthDate).HasColumnName("SL_BirthDate");
            this.Property(t => t.SL_Nationality).HasColumnName("SL_Nationality");
            this.Property(t => t.SL_Email).HasColumnName("SL_Email");
            this.Property(t => t.SL_HomePhone).HasColumnName("SL_HomePhone");
            this.Property(t => t.SL_BusinessPhone).HasColumnName("SL_BusinessPhone");
            this.Property(t => t.SL_Mobile).HasColumnName("SL_Mobile");
            this.Property(t => t.SL_User).HasColumnName("SL_User");
            this.Property(t => t.SL_Notes).HasColumnName("SL_Notes");
            this.Property(t => t.SL_CreatedBy).HasColumnName("SL_CreatedBy");
            this.Property(t => t.SL_CreatedOn).HasColumnName("SL_CreatedOn");
            this.Property(t => t.SL_Photo).HasColumnName("SL_Photo");
            this.Property(t => t.SL_Inactive).HasColumnName("SL_Inactive");
            this.Property(t => t.SL_ID2).HasColumnName("SL_ID2");
            this.Property(t => t.SPID).HasColumnName("SPID");
        }
    }
}
